#include "card.h"

Card::Card()
{

}

Card::Card(CardPoint point, CardSuit suit)
{
    Set_Point(point);
    Set_Suit(suit);
}

void Card::Set_Point(const CardPoint &point)
{
    point_ = point;
}

void Card::Set_Suit(const CardSuit &suit)
{
    suit_ = suit;
}

const Card::CardPoint &Card::Get_Point() const
{
    return point_;
}

const Card::CardSuit &Card::Get_Suit() const
{
    return suit_;
}

bool Card::operator==(const Card &right)
{
    return point_ == right.Get_Point() && suit_ == right.Get_Suit();
}

uint qHash(const Card &card)
{
    return card.Get_Point() * 100 + card.Get_Suit();
}

bool operator==(const Card&left, const Card&right)
{
    return left == right;
}

bool operator<(const Card&left, const Card&right)
{
    if(left.Get_Point() == right.Get_Point())
    {
        return left.Get_Suit() < right.Get_Suit();
    }
    else
    {
        return left.Get_Point() < right.Get_Point();
    }
}
